package org.ediba.siri.core.publication.service;

import java.util.Collection;
import java.util.List;
import java.util.Map;

import org.ediba.siri.core.Filter;
import org.ediba.siri.core.publication.domain.Publication;
import org.ediba.siri.core.publication.domain.PublicationCountry;
import org.ediba.siri.core.publication.domain.PublicationLevel;
import org.ediba.siri.core.publication.domain.PublicationNumber;

public interface PublicationService {
	
	abstract Publication create(int idPublicationCountry, String name);
	abstract Publication retrieve(int id);
	abstract Publication update(Publication publication);
	abstract boolean delete(int id);
	
	abstract List<Publication> retrieve();
	abstract List<Publication> retrieve(Map<Filter,Collection<Object>> filters, String sort, boolean dir);
	abstract int retrieveCount(Map<Filter,Collection<Object>> filters);
	abstract List<Publication> retrieve(String sort,boolean dir,int start, int limit);
	abstract List<Publication> retrieveByParticipant(int idUser);
	abstract List<Publication> retrieveByResponsible(int idUser);
	
	/******************** number *************************/
	abstract PublicationNumber numberCreate(int idPublication, int number);
	abstract PublicationNumber numberRetrieve(int id);
	abstract List<PublicationNumber> numberRetrieve(Map<Filter,Collection<Object>> filters, String sort, boolean dir);
	abstract int numberRetrieveCount(Map<Filter,Collection<Object>> filters);
	abstract PublicationNumber numberUpdate(PublicationNumber publicationNumber);
	abstract boolean numberDelete(int id);
	
	abstract PublicationNumber numberRetrieve(int idPublication, int number);
	abstract PublicationNumber numberRetrieveByPublication_last(int idPublication);
	abstract List<PublicationNumber> numberRetrieve();
	//abstract List<PublicationNumber> numberRetrieveByPublication(int idPublication);
	//abstract List<PublicationNumber> numberRetrieveByPublication(int idPublication,String sort,boolean dir,int start, int limit);
	abstract List<PublicationNumber> numberRetrieveByPublication_current(int idPublication);
	abstract List<PublicationNumber> numberRetrieveByImage(int idImage);
	abstract List<PublicationNumber> numberRetrieveByModel(int idModel);
	
	/******************** country *************************/
	abstract PublicationCountry countryCreate(String code, String name);
	abstract PublicationCountry countryRetrieve(int id);
	abstract PublicationCountry countryUpdate(PublicationCountry publicationCountry);
	abstract boolean countryDelete(int id);
	
	abstract List<PublicationCountry> countryRetrieve();
	abstract List<PublicationCountry> countryRetrieve(Map<Filter,Collection<Object>> filters, String sort, boolean dir);
	abstract int countryRetrieveCount(Map<Filter,Collection<Object>> filters);

	/******************** level *************************/
	abstract PublicationLevel levelCreate(String name);
	abstract PublicationLevel levelRetrieve(int id);
	abstract PublicationLevel levelUpdate(PublicationLevel publicationLevel);
	abstract boolean levelDelete(int id);
	
	abstract List<PublicationLevel> levelRetrieve();

}
